/**
 * Captain
 * © 2017 Captain copyright，All rights reserved.
 * http://www.sccaptain.com.cn
 * 
 * JAVA : 8
 * 文  件  名: Criterion.java
 * 创  建  人: liutao (liu.tao@sccaptain.com.cn)
 * 创建时间: 2017年8月2日 下午2:08:25
 * 版         本: 1.0.0
 * 备         注:
 * 修订历史:
 */
package com.material.c2c.core.criteria;

/**
 * 条件接口。
 * 用户提供条件表达式接口。
 * 
 * @since 1.0
 * @version 1.0
 * @author liutao (liu.tao@sccaptain.com.cn)
 */
public interface Criterion {
  
  public enum BooleanOperator{
    
    AND(" and "),
    OR(" or ");
    
    BooleanOperator(String booleanOperator) {
      this.booleanOperator = booleanOperator;
    }

    private String booleanOperator;

    public String getBooleanOperator() {
      return booleanOperator;
    }

    public void setBooleanOperator(String booleanOperator) {
      this.booleanOperator = booleanOperator;
    }
  }
  
  public enum MatchMode { 
    LEFT, RIGHT, ANYWHERE  
  }  
  
  public enum Operator{
    
    /** 等于 */
    EQ(" = "),
    
    /** 不等于 */
    NE(" != "),
    
    /** 大于 */
    GT(" > "),
    
    /** 大于等于 */
    GTE(" >= "),
    
    /** 小于 */
    LT(" < "),
    
    /** 小于 */
    LTE(" <= "),
    
    /** 类似 */
    LIKE(" like "),
    
    IN( " in "),
    
    /** 为Null */
    ISNULL(" is NULL "),
    
    /** 不为Null */
    ISNOTNULL(" is not NULL ");
    
    Operator(String operator) {
      this.operator = operator;
    }

    private String operator;

    public String getOperator() {
      return operator;
    }

    public void setOperator(String operator) {
      this.operator = operator;
    }
  }
}
